import request from '@/utils/request'

// 创建保养任务
export function createMaintainTask(data) {
  return request({
    url: '/ems/maintain-task/create',
    method: 'post',
    data: data
  })
}

// 更新保养任务
export function updateMaintainTask(data) {
  return request({
    url: '/ems/maintain-task/update',
    method: 'put',
    data: data
  })
}

// 删除保养任务
export function deleteMaintainTask(id) {
  return request({
    url: '/ems/maintain-task/delete?id=' + id,
    method: 'delete'
  })
}

// 获得保养任务
export function getMaintainTask(id) {
  return request({
    url: '/ems/maintain-task/get?id=' + id,
    method: 'get'
  })
}

// 获得保养任务分页
export function getMaintainTaskPage(query) {
  return request({
    url: '/ems/maintain-task/page',
    method: 'get',
    params: query
  })
}

// 导出保养任务 Excel
export function exportMaintainTaskExcel(query) {
  return request({
    url: '/ems/maintain-task/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
